Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

fix orderData to be nullable #3251

Merged
merged 1 commit into from
Oct 13, 2023

Conversation

samuelbirch
Copy link
Contributor

Description

Fixes: TypeError: Cannot assign null to property craft\commerce\events\MailEvent::$orderData of type array

when using the EVENT_BEFORE_SEND_MAIL event

@samuelbirch samuelbirch requested a review from a team as a code owner August 15, 2023 10:48
@nfourtythree
Copy link
Contributor

Hi @samuelbirch

Thank you for this, does this come up in normal operation of Commerce or did you see it due to any custom code?

Thanks!

@samuelbirch
Copy link
Contributor Author

Hey @nfourtythree

I'm calling Commerce::getInstance()->getEmails()->sendEmail($email, $order); within a controller action.

to get around it i've had to do Commerce::getInstance()->getEmails()->sendEmail($email, $order, null, []);

Cheers

@nfourtythree
Copy link
Contributor

Hi @samuelbirch

Thank you for this, will get it merged now!

Thanks.

@nfourtythree nfourtythree merged commit de38403 into craftcms:develop Oct 13, 2023
8 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants